#! /usr/bin/env python

# Jeremy's test code.
# (scezumin)

import time
import sys
from simulation import *

map_file_name = "map3x3.json"
number_of_trials = 100
directory = "trials/"
dot_period = 1
line_period = 100

for intensity in [0.1, 1.0, 10.0, 100.0, 1000.0]:
	
	print "Beginning trials with %s millicurie source present" % intensity
	for i in range(number_of_trials):
		output_file_name = directory + "source_" + str(intensity) + \
		                   "_present" + str(i)
		sim = SweepSimulation(map_file_name,
						debug_mode=False,
						heatmapOn=True,
						visualsOn=False,
						outputfile=output_file_name)
		sim.emitters[0].setIntensity(intensity)
		sim.run()
		if (i % dot_period) == dot_period - 1:
			sys.stderr.write('.')
		if (i % line_period) == line_period - 1:
			sys.stderr.write('\n')
	
print "Beginning trials with source absent"
for i in range(number_of_trials):
	output_file_name = directory + "source_absent" + str(i)
	sim = SweepSimulation(map_file_name,
					debug_mode=False,
					heatmapOn=True,
					visualsOn=False,
					outputfile=output_file_name)
	# manually remove emitters from field
	sim.emitters = {}
	sim.run()
	if (i % dot_period) == dot_period - 1:
		sys.stderr.write('.')
	if (i % line_period) == line_period - 1:
		sys.stderr.write('\n')